import os

class PortPrperties:
    """端口属性类"""

    port = -1

    """是否已经被使用"""
    has_been_use = True


    def __init__(self, port=int):
        self.port = port
        self.get_port_properties()

    def get_port_properties(self):
        """获取端口属性"""
        result = os.popen("lsof -i:{}| wc -l".format(self.port))
        self.has_been_use = int(result.read()) != 0
